package com.cykj.controller;

import com.alibaba.fastjson.JSON;
import com.cykj.bean.Message;
import com.cykj.bean.TbGame;
import com.cykj.service.GameDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/GameDetailsColltroller")
public class GameDetailsColltroller {

    @Autowired
    GameDetailsService gameDetailsService;

    @RequestMapping("/getinf")
    public Message getinf(Long id){
        Message message = new Message();
        TbGame tbGame = gameDetailsService.getinf(id);
        if (tbGame != null){
            message.setCode(200);
            if (tbGame.getPublisherId() == null){
                tbGame.setPublisherName("doudou");
            }
            message.setData(tbGame);
        }
        return message;
    }


}
